#include <iostream>
#include <vector>
using namespace std;


int main(){
    vector<int> even, odd;
    int x;
    while(cin >> x){
        if(x % 2 == 0) even.push_back(x);
        else odd.push_back(x);
        if(cin.get() == '\n') break;
    }
    sort(odd.rbegin(), odd.rend());
    sort(even.begin(), even.end());

    for(auto item:odd){
        cout << item << ' ';
    }
    for(auto item:even){
        cout << item << ' ';
    }
    return 0;
}